<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>AdminLTE 2 | Starter</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="/stylesheets/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="/stylesheets/Ionicons/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="/stylesheets/AdminLTE.min.css">
  <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
        page. However, you can choose any other skin. Make sure you
        apply the skin class to the body tag so the changes take effect. -->
  <link rel="stylesheet" href="/stylesheets/skins/skin-blue.min.css">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet"
    href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<!--
BODY TAG OPTIONS:
=================
Apply one or more of the following classes to get the
desired effect
|---------------------------------------------------------|
| SKINS         | skin-blue                               |
|               | skin-black                              |
|               | skin-purple                             |
|               | skin-yellow                             |
|               | skin-red                                |
|               | skin-green                              |
|---------------------------------------------------------|
|LAYOUT OPTIONS | fixed                                   |
|               | layout-boxed                            |
|               | layout-top-nav                          |
|               | sidebar-collapse                        |
|               | sidebar-mini                            |
|---------------------------------------------------------|
-->

<body class="hold-transition skin-blue sidebar-mini">
  <div class="wrapper">

    <!-- Main Header -->
    <%- include("./header.ejs")%>

      <!-- Left side column. contains the logo and sidebar -->
      <%- include("./aside.ejs")%>
        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
          <!-- Content Header (Page header) -->
          <section class="content-header">
            <h1>商品信息管理</h1>
          </section>

          <!-- Main content -->
          <section class="content container-fluid">
            <div class="box">
              <!-- /.box-header -->
              <div class="box-body">
                <div id="example1_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                  <div class="row">
                    <div class="col-sm-4">
                      <div class="dataTables_length" id="example1_length"><label>Show <select name="example1_length"
                            aria-controls="example1" class="form-control input-sm">
                            <option value="10">10</option>
                            <option value="25">25</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                          </select> entries</label></div>
                    </div>
                    <div class="col-sm-4">
                      <form action="/pro/search" method="get">
                        <div id="example1_filter" class="dataTables_filter">
                          <label>搜索:<input type="search"
                              class="form-control input-sm" placeholder="请输入要搜索的商品" aria-controls="example1" name="search">
                              <button type="submit" class="btn btn-info fa fa-search"></button>
                              <a href="/pro" class="btn btn-info fa fa-reply fa-search"></a></label></div>
                      </form>
                    </div>
                    <div class="col-sm-2">
                      <div id="example1_filter" class="dataTables_filter"><a href="/pro/xlsx"
                          class="btn btn-success btn-block">导入信息</a></div>
                    </div>
                    <div class="col-sm-2">
                      <div id="example1_filter" class="dataTables_filter"><a href="/pro/add"
                          class="btn btn-info btn-block">添加信息</a></div>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-sm-12">
                      <table id="example1" class="table table-bordered table-striped dataTable" role="grid"
                        aria-describedby="example1_info">
                        <thead>
                          <tr role="row">
                            <th class="sorting_asc" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">序号
                            </th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Browser: activate to sort column ascending">品牌
                            </th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Platform(s): activate to sort column ascending"">
                              Logo</th>
                            <th class=" sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Engine version: activate to sort column ascending"">分类</th>
                            <th class=" sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="CSS grade: activate to sort column ascending">图片</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="CSS grade: activate to sort column ascending">名称</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="CSS grade: activate to sort column ascending">价格
                              <a href="/pro/sort?price=1" class="btn btn-info fa fa-long-arrow-up"></a>
                              <a href="/pro/sort?price=-1" class="btn btn-info fa fa-long-arrow-down"></a>
                            </th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="CSS grade: activate to sort column ascending">销量
                              <a href="/pro/sort?sales=1" class="btn btn-info fa fa-long-arrow-up"></a>
                              <a href="/pro/sort?sales=-1" class="btn btn-info fa fa-long-arrow-down"></a></th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="CSS grade: activate to sort column ascending">库存</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="CSS grade: activate to sort column ascending">折扣</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="CSS grade: activate to sort column ascending">评分</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="CSS grade: activate to sort column ascending" style="width: 130px;">操作</th>
                          </tr>
                        </thead>
                        <tbody>
                          <% for(var i=0;i<data.length;i++){ %>
                            <tr>
                              <td>
                                <%= i+1 %>
                              </td>
                              <td>
                                <%= data[i].brand %>
                              </td>
                              <td><img src="<%= data[i].logo %>" alt="" width="100">
                              </td>
                              <td>
                                <%= data[i].classify %>
                              </td>
                              <td>
                                <img src="<%= data[i].goodsImg %>" alt="" width="100">

                              </td>
                              <td style="width: 200px;">
                                <%= data[i].goodsName %>
                              </td>
                              <td>
                                <%= data[i].price %>
                              </td>
                              <td>
                                <%= data[i].sales %>
                              </td>
                              <td>
                                <%= data[i].stock %>
                              </td>
                              <td>
                                <%= data[i].discount %>
                              </td>
                              <td>
                                <%= data[i].score %>
                              </td>
                              <td>
                                <a href="/pro/del?id=<%= data[i].goodsId %>" class="btn btn-warning">删除</a>
                                <a href="" class="btn btn-primary">修改</a>
                              </td>
                            </tr>
                            <% } %>
                        </tbody>

                      </table>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-sm-3">
                      <div class="dataTables_info" id="example1_info" role="status" aria-live="polite"></div>
                    </div>
                    <div class="col-sm-9">
                      <div class="dataTables_paginate paging_simple_numbers" id="example1_paginate">
                        <ul class="pagination">
                          <li class="paginate_button previous disabled" id="example1_previous"><a href="#"
                              aria-controls="example1" data-dt-idx="0" tabindex="0">Previous</a></li>
                          <% for(var i=0;i<pageNum;i++){ %>
                            <li class="paginate_button <%= i==pageIndex ? 'active' : '' %> ">
                              <a href="/pro/paging?index=<%= i %>" aria-controls="example1" data-dt-idx="1"
                              tabindex="0"><%= i+1 %></a></li>
                            <% } %>
                          <li class="paginate_button next" id="example1_next"><a href="#" aria-controls="example1"
                              data-dt-idx="7" tabindex="0">Next</a></li>
                        </ul>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <!-- /.box-body -->
            </div>
          </section>
          <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->

        <!-- Main Footer -->
        <%- include("./footer.ejs")%>


          <!-- Control Sidebar -->
          <!-- /.control-sidebar -->
          <!-- Add the sidebar's background. This div must be placed
  immediately after the control sidebar -->
  </div>
  <!-- ./wrapper -->

  <!-- REQUIRED JS SCRIPTS -->

  <!-- jQuery 3 -->
  <script src="/javascripts/jquery.min.js"></script>
  <!-- Bootstrap 3.3.7 -->
  <script src="/javascripts/bootstrap.min.js"></script>
  <!-- AdminLTE App -->
  <script src="/javascripts/adminlte.min.js"></script>

  <!-- Optionally, you can add Slimscroll and FastClick plugins.
     Both of these plugins are recommended to enhance the
     user experience. -->
</body>

</html>